<!DOCTYPE html>
<html>
  <head>
  	<div th:include="base-libs :: base-libs" />
  	<script th:src="'/quickJs/scripts/easyui/1.5.2/plugins/datagrid-emptyview.js'"></script>
    <title>报表审核记录</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <style>
    	.datagrid-empty{
    		font-size:20px;font-weight:bold;color:lightcoral
    	}
    </style>
    <script>
    	var BBID = StoreCache.removeCache("BBID");
    	$(function(){
            $(this).registerManagerPage({cacheTables:["TB_ZY_BBZT"],callback:initView});
    	})
    	
    	function initView(cacheTable){
            var shztObj = getBbztObj(cacheTable.TB_ZY_BBZT); //获取报表状态jsondui对象，减少datagrid中审核结果字段for循环
    		$('#shjlTb').datagrid({
				striped : true,
				clickToSelect: true,
				fit:true,
				fitColumns: true,
				singleSelect: true,
				scrollbarSize:0,
				pagination : true,
				pageNumber : 1,
				pageSize : 10,
				pageList: [10, 25, 50, 100, 200],
				scrollBarSize:0,
				border: false,
				view: emptyView,
				emptyMsg: '暂无审核记录',
				columns:[[
						{field:'SHSJ', title:'审核时间', width: 70, align: 'center'},
		   				{field:'SHJG', title:'审核结果', width: 50, align: 'center', formatter: function(value){
		   					return shztObj[value] || value;
		   				}},
						{field:'JGMC', title:'审核人员', width: 80, align: 'center'},
						{field:'BZ', title:'备注', width: 130, align: 'center', formatter: function(value){
							return '<span title="'+value+'">'+value+'</span>';
						}}
				]],
				onBeforeLoad: function(params){
					if(StringUtils.isEmpty(BBID)){
						return false;
					}else{
						params.BBID = BBID;
					}
				},
				onLoadSuccess: function(data){
// 						alert(JSON.stringify(data))
				},
				url: contextRoot+"wsj/queryShjlByPage.service"
		    })
    	}

    	/** 获取报表状态json对象 */
    	function getBbztObj(bbztAry){
    	    var back = {};
    	    $.each(bbztAry, function(){
    	        back[this.XMDM] = this.XMMC;
            })
            return back;
        }
    </script>
  </head>
  
  <body class="easyui-layout">
    <div region="center" fit="true" border="false">
    	<table id="shjlTb"></table>
    </div>
  </body>
</html>
